﻿-- Author      : Kurapica
-- Create Date : 6/12/2008 1:13:42 AM

-- Font 
do	
	-- Check Version
	local version = 1
	if not IGAS:RegisterFile("IGAS.GUI.Widget.Font", version) then
		return
	end

    local getmetatable = getmetatable
    local pairs = pairs
    local ipairs = ipairs
    local type = type
    local error = error
    local CreateFrame = CreateFrame
    
	local _WidgetName = "Font"
    local _Base = "FontInstance"

	local _GUI = IGAS.GUI
	local _Widget = IGAS.GUI.Widget	
    local _BaseFunc = IGAS.GUI.Base.Func
	local _PropertyType = IGAS.GUI.Base.PropertyType   
	
    -- FuncProxy
	local _FuncProxy = {
        --- Original Functions
        -- CopyFontObject(otherFont) - Set this Font's attributes to be a copy of the otherFont font object's. 
        ["CopyFontObject"] = function(self, otherFont)
            local _other = _BaseFunc.GetUI(otherFont)
            if _other then
                self.__UI:CopyFontObject(_other)
            else
                error("No such font")
            end
        end,
    }
    
    local _WidgetInfo = {
        ["WidgetName"] = _WidgetName,
        ["Base"] = _Base,
        ["FuncProxy"] = _FuncProxy,
    }
    
    _Widget[_WidgetName] = _GUI.NewWidget(_WidgetInfo)
end